/**
 * Copyright (c) 快宝网络 kuaidihelp.com Co., Ltd. All Rights Reserved 禁止外泄以及用于其它的商业用途
 */

import request from '@/utils/request';
import { message } from 'antd';

// 获取语音包列表
export async function getJdkVoiceList(params: any) {
  return request('/jdk/voices/list', {
    method: 'POST',
    data: params,
  }).then((res) => {
    const { code, data, msg } = res;
    if (code != 0) {
      message.error(msg);
    }
    const list = Array.isArray(data) ? data : [];
    return {
      data: list,
    };
  });
}

// 获取语音包列表
export async function getVoiceUpdateDate() {
  return request('/jdk/voices/updateDate', {
    method: 'POST',
  }).then((res) => {
    const { code, msg } = res;
    if (code == 0) {
      message.success('更新成功');
    } else {
      message.error(msg);
    }
  });
}
